// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
  //  img:"../image/add.png"
    showType:3,
    value:[],
    lists:[],
    inputValue:''
  },
  // 事件处理函数

  onLoad() {
    if (wx.getUserProfile) {
      this.setData({
        canIUseGetUserProfile: true
      })
    }
  },
  getValue:function(e){
    var value=e.detail.value;
    this.setData({
      value:value
    })
  },
  addList:function(e){
    var lists=this.data.lists;
    var value=this.data.value;
    var list=new Array();
    for( var i in value){
      list.push(value[i]);
    }
    var l=list.join('');
    list.length=0;
    list.push(l);
    console.log(list);
    this.setData({
       lists:list,
       inputValue:''
    })
  },
  Delete:function(e){
    var index=e.currentTarget.dataset.index;
    var lists=new Array();
    for(var i in this.data.lists){
      lists.push(this.data.lists[i]);
    }
    lists.pop(index);
    this.setData({
      lists:lists
    })
  },
  switchTab: function(event) {
    let showType = event.currentTarget.dataset.index;
    wx.setStorageSync('showType', showType);
    this.setData({
        showType: showType,
        size: 5
    });
},

})
